Depth-splice rigged attachment alpha into world alpha#5927
Conversation
948780d to
ae98514
Compare
|
@Geenz any opinion on this? |
|
@Ansariel @Viscerous I will be taking a closer look at this tomorrow. Hopefully prior to the open source meeting. I have a few concerns with the technique, but I just need to squint at it in realtime before I make a judgement here. |
|
@Geenz I had some more time to test this. The main regression I found was standalone animesh: it could be composited in front of world alpha regardless of depth, while its own alpha ordering could also be disturbed. I factored the depth calculation into I also covered some of the other scenarios: the shared alpha lists stay in legacy order and are re-sorted only immediately before the eligible post-water world pass. Pre-water, HUD, shadow, reflection, cube and feature-off rendering retain the legacy two-pass path. Exact-depth ties now follow the same ensemble order in both sorted streams and the merge. Within an avatar or animesh ensemble it deliberately retains the established behaviour: rigged first, then unrigged groups back-to-front, while the ensemble as a whole interleaves with world alpha. Unstamped world groups keep their normal bounds depth. Remaining weak point: alpha groups within alpha groups (e.g. avatar hair inside building with windows) don't have the granularity to resolve deterministically, these will be view-dependent; will likely not get cleaner without going finer-grain like OIT. |
The viewer currently renders alpha in two separate passes: rigged alpha first, grouped by avatar pointer, followed by unrigged alpha back-to-front. Since most avatar alpha is rigged and most world alpha is not, the two cannot be ordered against each other. This causes familiar failures such as foreground hair rejecting trees behind it, while pointer-based avatar ordering can also differ between viewers.
This PR interleaves both streams in one back-to-front walk. Avatars and standalone animesh are keyed from their animated extents, while rigged attachments retain attachment-slot order. Non-HUD unrigged attachments inherit the wearer’s depth, so an avatar drains as one block: rigged first, followed by its unrigged groups back-to-front. This preserves the ordering content has historically been authored against within an avatar while giving the avatar a meaningful position among world alpha. Avatar depth lives in a dedicated
mAvatarDepthkey; the existing bounds-derivedmDepthremains unchanged for world alpha and ordering within an attachment. Exact-depth ties use explicit ordering, with pointer identity only as the final tie-breaker.Interleaving is enabled by
RenderInterleavedAlphafor the normal post-water world pass. Pre-water, HUD, shadow, reflection, cube and other special renders retain the legacy ordering. Disabling the setting restores the legacy two-pass rendering path.QA note: Feature-off is not byte-for-byte identical to upstream ordering. Attachment stamps now fan out from a bridge to every alpha group in its linkset, so multi-group rigged attachments can sort differently and more consistently, even with interleaving disabled. Stamps on unrigged groups are inert in the legacy world sort.
2026-06-15.18-07-48.mp4